
Distance based regression models for proportions.
ols.prop.reg(y, x, cov = FALSE, tol = 1e-07, maxiters = 100)
helling.prop.reg(y, x, tol = 1e-07, maxiters = 100)
A numerical vector proportions. 0s and 1s are allowed.
A matrix or a data frame with the predictor variables.
Should the covariance matrix be returned? TRUE or FALSE.
The tolerance value to terminate the Newton-Raphson algorithm. This is set to
The maximum number of iterations before the Newton-Raphson is terminated automatically.
A list including:
The sum of squres of errors for the "ols.prop.reg" function.
The estimated regression coefficients.
The standard error of the regression coefficients if "cov" is TRUE.
The covariance matrix of the regression coefficients in "ols.prop.reg" if "cov" is TRUE.
The Hellinger distance between the true and the obseervd proportions in "helling.prop.reg".
The number of iterations required by the Newton-Raphson.
We are using the Newton-Raphson, but unlike R's built-in function "glm" we do no checks and no extra calculations, or whatever. Simply the model. The functions accept binary responses as well (0 or 1).
Papke L. E. & Wooldridge J. (1996). Econometric methods for fractional response variables with an application to 401(K) plan participation rates. Journal of Applied Econometrics, 11(6): 619--632.
McCullagh, Peter, and John A. Nelder. Generalized linear models. CRC press, USA, 2nd edition, 1989.
# NOT RUN {
y <- rbeta(100, 1, 4)
x <- matrix(rnorm(100 * 2), ncol = 2)
a1 <- ols.prop.reg(y, x)
a2 <- helling.prop.reg(y, x)
# }
Run the code above in your browser using DataLab